#include "udri.h"

void dri_register_interrupt(uint8_t irq, dri_interrupt_handler handler){
	syscall_parameter_block nomalloc_spb;
	nomalloc_spb.scp_magic = SCP_MAGIC;
	nomalloc_spb.function_id = SC_REGIR;
	nomalloc_spb.parameters[0] = (uint32_t) irq;
	nomalloc_spb.parameters[1] = (uint32_t) handler;
	syscall(&nomalloc_spb);
}

void dri_register_specfile(char *name,uint32_t flags,uint32_t inode,uint32_t mode,read_fs_t read_hook,write_fs_t write_hook){
	syscall_parameter_block nomalloc_spb;
	nomalloc_spb.scp_magic = SCP_MAGIC;
	nomalloc_spb.function_id = SC_REGSF;
	nomalloc_spb.parameters[0] = (uint32_t) name;
	nomalloc_spb.parameters[1] = flags;
	nomalloc_spb.parameters[2] = inode;
	nomalloc_spb.parameters[3] = mode;
	nomalloc_spb.parameters[4] = (uint32_t) read_hook;
	nomalloc_spb.parameters[5] = (uint32_t) write_hook;
	syscall(&nomalloc_spb);
}
void dri_register_driver(dri_driver_descriptor_t *desc){
	syscall_parameter_block nomalloc_spb;
	nomalloc_spb.scp_magic = SCP_MAGIC;
	nomalloc_spb.function_id = SC_REGDR;
	nomalloc_spb.parameters[0] = (uint32_t) desc;
	syscall(&nomalloc_spb);
}